import React, { Component } from 'react';
import { StyleSheet, Text, View, Button, Platform } from 'react-native';

export default class Header extends Component{

     render() {
      const { title,styles } = this.props
      return (
        <View>
          <Text style={styles?styles:null}>{title}</Text>
        </View>
      )
    }
}

export class HeaderLeft extends Component{

     render() {
       
      const { title,styles,navigation } = this.props
      return (
          <View>
              <Text 
                onPress={() => navigation.goBack()}>back</Text>
                
          </View>
      )
    }
}
export  var HeaderProps = (props) => {
  var {title,headerTitle,headerTintColor,headerStyle,headerLeft,headerRight,headerTitleStyle,navigation} = props;
  var header ={
      title: title,
      headerTitle: headerTitle,
      headerTintColor: headerTintColor?headerTintColor:'#555',
      headerStyle: null,
      headerLeft:
          <View>
              <Text 
                onPress={() => navigation.goBack()}>back</Text>
                
          </View>,
      headerRight: <Text />,
      headerTitleStyle: {
        fontSize: 15,
        zIndex: 100,
        alignSelf: 'center',
        textAlign: 'center',
      },
    }


  return header;
}